<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8" %>
<!DOCTYPE html>
<html>
<head>
    <title>Edit Student</title>
    <link rel="stylesheet" href="styles2.css"> <!-- Referencing the same CSS file -->
    <style>
        .edit-student-form {
            background-color: #ffffff;
            padding: 20px;
            margin: 10px;
            border-radius: 8px;
            box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);
            width: fit-content; /* Adjusts width to fit contents */
            margin-left: auto;
            margin-right: auto;
        }

        h1 {
            text-align: center;
            color: #333;
        }

        table {
            margin-bottom: 20px; /* Additional margin below the form table */
        }

        input[type="submit"] {
            background-color: #4caf50;
            color: #fff;
            border: none;
            padding: 10px 15px;
            text-align: center;
            text-decoration: none;
            display: inline-block;
            font-size: 16px;
            margin: 5px;
            border-radius: 4px;
            cursor: pointer;
        }

        input[type="submit"]:hover {
            background-color: #45a049;
        }

        /* Other styles can also be added as needed */
    </style>
</head>
<body>
<div class="edit-student-form">
    <h1>Edit Student</h1>
    <form action="/updateTeacher" method="post"> <!-- Use JSTL to rewrite URLs -->
        <table>
            <tr>
                <td>教师号：</td>
                <td><input type="text" name="id" value="${teacher.id}" readonly></td>
            </tr>
            <tr>
                <td>教师姓名：</td>
                <td><input type="text" name="name" value="${teacher.name}"></td>
            </tr>
            <tr>
                <td>教师性别：</td>
                <td>
                    <select name="gender">
                        <option value="男" ${teacher.gender == "男" ? "selected" : ""}>男</option>
                        <option value="女" ${teacher.gender == "女" ? "selected" : ""}>女</option>
                    </select>
                </td>
            </tr>
            <tr>
                <td>教师年龄：</td>
                <td><input type="number" name="age" value="${teacher.age}"></td>
            </tr>
            <tr>
                <td>职称：</td>
                <td><input type="text" name="office" value="${teacher.office}"></td>
            </tr>
            <tr>
                <td>电话：</td>
                <td><input type="text" name="phone" value="${teacher.phone}"></td>
            </tr>
        </table>
        <input type="submit" value="提交">
        <input type="button" class="button" onclick="window.location.href='adminHome'" value="返回">
    </form>
</div>
</body>
</html>